home *** CD-ROM | disk | FTP | other *** search
/ PC World 2008 February (DVD) / PCWorld_2008-02_DVD.iso / v cisle / PHP / PHP.exe / xampp-win32-1.6.5-installer.exe / php / PEAR / HTML / Table.php < prev    next >
Encoding:
PHP Script  |  2007-12-20  |  21.8 KB  |  661 lines

  1. <?php
  2. /* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
  3.  
  4. /**
  5.  * PEAR::HTML_Table makes the design of HTML tables easy, flexible, reusable and efficient.
  6.  *
  7.  * The PEAR::HTML_Table package provides methods for easy and efficient design of HTML tables.
  8.  * - Lots of customization options.
  9.  * - Tables can be modified at any time.
  10.  * - The logic is the same as standard HTML editors.
  11.  * - Handles col and rowspans.
  12.  * - PHP code is shorter, easier to read and to maintain.
  13.  * - Tables options can be reused.
  14.  *
  15.  * For auto filling of data and such then check out http://pear.php.net/package/HTML_Table_Matrix
  16.  *
  17.  * PHP versions 4 and 5
  18.  *
  19.  * LICENSE: This source file is subject to the new BSD license that is bundled
  20.  * with this package in the file LICENSE.
  21.  * It is also available through the world-wide-web at this URL:
  22.  * http://www.opensource.org/licenses/bsd-license.php
  23.  * If you did not receive a copy of the license and are unable to
  24.  * obtain it through the world-wide-web, please send an email
  25.  * to wiesemann@php.net so we can send you a copy immediately.
  26.  
  27.  *
  28.  * @category   HTML
  29.  * @package    HTML_Table
  30.  * @author     Adam Daniel <adaniel1@eesus.jnj.com>
  31.  * @author     Bertrand Mansion <bmansion@mamasam.com>
  32.  * @copyright  2005-2006 The PHP Group
  33.  * @license    http://www.opensource.org/licenses/bsd-license.php New BSD License
  34.  * @version    CVS: $Id: Table.php,v 1.34 2006/11/09 20:47:41 wiesemann Exp $
  35.  * @link       http://pear.php.net/package/HTML_Table
  36.  */
  37.  
  38.  
  39. /**
  40. * Requires PEAR, HTML_Common and HTML_Table_Storage
  41. */
  42. require_once 'PEAR.php';
  43. require_once 'HTML/Common.php';
  44. require_once 'HTML/Table/Storage.php';
  45.  
  46. /**
  47.  * PEAR::HTML_Table makes the design of HTML tables easy, flexible, reusable and efficient.
  48.  *
  49.  * The PEAR::HTML_Table package provides methods for easy and efficient design of HTML tables.
  50.  * - Lots of customization options.
  51.  * - Tables can be modified at any time.
  52.  * - The logic is the same as standard HTML editors.
  53.  * - Handles col and rowspans.
  54.  * - PHP code is shorter, easier to read and to maintain.
  55.  * - Tables options can be reused.
  56.  *
  57.  * For auto filling of data and such then check out http://pear.php.net/package/HTML_Table_Matrix
  58.  *
  59.  * @category   HTML
  60.  * @package    HTML_Table
  61.  * @author     Adam Daniel <adaniel1@eesus.jnj.com>
  62.  * @author     Bertrand Mansion <bmansion@mamasam.com>
  63.  * @copyright  2005-2006 The PHP Group
  64.  * @license    http://www.opensource.org/licenses/bsd-license.php New BSD License
  65.  * @version    Release: @package_version@
  66.  * @link       http://pear.php.net/package/HTML_Table
  67.  */
  68. class HTML_Table extends HTML_Common {
  69.  
  70.     /**
  71.      * Value to insert into empty cells
  72.      * @var    string
  73.      * @access private
  74.      */
  75.     var $_autoFill = ' ';
  76.  
  77.     /**
  78.      * Array containing the table caption
  79.      * @var     array
  80.      * @access  private
  81.      */
  82.     var $_caption = array();
  83.  
  84.     /**
  85.      * Array containing the table column group specifications
  86.      *
  87.      * @var     array
  88.      * @author  Laurent Laville (pear at laurent-laville dot org)
  89.      * @access  private
  90.      */
  91.     var $_colgroup = array();
  92.  
  93.     /**
  94.      * HTML_Table_Storage object for the (t)head of the table
  95.      * @var    object
  96.      * @access private
  97.      */
  98.     var $_thead = null;
  99.  
  100.     /**
  101.      * HTML_Table_Storage object for the (t)foot of the table
  102.      * @var    object
  103.      * @access private
  104.      */
  105.     var $_tfoot = null;
  106.  
  107.     /**
  108.      * HTML_Table_Storage object for the (t)body of the table
  109.      * @var    object
  110.      * @access private
  111.      */
  112.     var $_tbody = null;
  113.  
  114.     /**
  115.      * Whether to use <thead>, <tfoot> and <tbody> or not
  116.      * @var    bool
  117.      * @access private
  118.      */
  119.     var $_useTGroups = false;
  120.  
  121.     /**
  122.      * Class constructor
  123.      * @param    array    $attributes        Associative array of table tag attributes
  124.      * @param    int      $tabOffset         Tab offset of the table
  125.      * @param    bool     $useTGroups        Whether to use <thead>, <tfoot> and
  126.      *                                       <tbody> or not
  127.      * @access   public
  128.      */
  129.     function HTML_Table($attributes = null, $tabOffset = 0, $useTGroups = false)
  130.     {
  131.         HTML_Common::HTML_Common($attributes, (int)$tabOffset);
  132.         $this->_useTGroups = (boolean)$useTGroups;
  133.         $this->_tbody =& new HTML_Table_Storage($tabOffset, $this->_useTGroups);
  134.         if ($this->_useTGroups) {
  135.             $this->_thead =& new HTML_Table_Storage($tabOffset, $this->_useTGroups);
  136.             $this->_tfoot =& new HTML_Table_Storage($tabOffset, $this->_useTGroups);
  137.         }
  138.     }
  139.  
  140.     /**
  141.      * Returns the API version
  142.      * @access  public
  143.      * @return  double
  144.      * @deprecated
  145.      */
  146.     function apiVersion()
  147.     {
  148.         return 1.7;
  149.     }
  150.  
  151.     /**
  152.      * Returns the HTML_Table_Storage object for <thead>
  153.      * @access  public
  154.      * @return  object
  155.      */
  156.     function &getHeader()
  157.     {
  158.         if (is_null($this->_thead)) {
  159.             $this->_useTGroups = true;
  160.             $this->_thead =& new HTML_Table_Storage($this->_tabOffset,
  161.                                                     $this->_useTGroups);
  162.             $this->_tbody->setUseTGroups(true);
  163.         }
  164.         return $this->_thead;
  165.     }
  166.  
  167.     /**
  168.      * Returns the HTML_Table_Storage object for <tfoot>
  169.      * @access  public
  170.      * @return  object
  171.      */
  172.     function &getFooter()
  173.     {
  174.         if (is_null($this->_tfoot)) {
  175.             $this->_useTGroups = true;
  176.             $this->_tfoot =& new HTML_Table_Storage($this->_tabOffset,
  177.                                                     $this->_useTGroups);
  178.             $this->_tbody->setUseTGroups(true);
  179.         }
  180.         return $this->_tfoot;
  181.     }
  182.  
  183.     /**
  184.      * Returns the HTML_Table_Storage object for <tbody>
  185.      * (or the whole table if <t{head|foot|body> is not used)
  186.      * @access  public
  187.      * @return  object
  188.      */
  189.     function &getBody()
  190.     {
  191.         return $this->_tbody;
  192.     }
  193.  
  194.     /**
  195.      * Sets the table caption
  196.      * @param   string    $caption
  197.      * @param   mixed     $attributes        Associative array or string of table row attributes
  198.      * @access  public
  199.      */
  200.     function setCaption($caption, $attributes = null)
  201.     {
  202.         $attributes = $this->_parseAttributes($attributes);
  203.         $this->_caption = array('attr' => $attributes, 'contents' => $caption);
  204.     }
  205.  
  206.     /**
  207.      * Sets the table columns group specifications, or removes existing ones.
  208.      *
  209.      * @param   mixed     $colgroup         (optional) Columns attributes
  210.      * @param   mixed     $attributes       (optional) Associative array or string
  211.      *                                                 of table row attributes
  212.      * @author  Laurent Laville (pear at laurent-laville dot org)
  213.      * @access  public
  214.      */
  215.     function setColGroup($colgroup = null, $attributes = null)
  216.     {
  217.         if (isset($colgroup)) {
  218.             $attributes = $this->_parseAttributes($attributes);
  219.             $this->_colgroup[] = array('attr' => $attributes,
  220.                                        'contents' => $colgroup);
  221.         } else {
  222.             $this->_colgroup = array();
  223.         }
  224.     }
  225.  
  226.     /**
  227.      * Sets the autoFill value
  228.      * @param   mixed   $fill
  229.      * @access  public
  230.      */
  231.     function setAutoFill($fill)
  232.     {
  233.         $this->_tbody->setAutoFill($fill);
  234.     }
  235.  
  236.     /**
  237.      * Returns the autoFill value
  238.      * @access   public
  239.      * @return   mixed
  240.      */
  241.     function getAutoFill()
  242.     {
  243.         return $this->_tbody->getAutoFill();
  244.     }
  245.  
  246.     /**
  247.      * Sets the autoGrow value
  248.      * @param    bool   $fill
  249.      * @access   public
  250.      */
  251.     function setAutoGrow($grow)
  252.     {
  253.         $this->_tbody->setAutoGrow($grow);
  254.     }
  255.  
  256.     /**
  257.      * Returns the autoGrow value
  258.      * @access   public
  259.      * @return   mixed
  260.      */
  261.     function getAutoGrow()
  262.     {
  263.         return $this->_tbody->getAutoGrow();
  264.     }
  265.  
  266.     /**
  267.      * Sets the number of rows in the table
  268.      * @param    int     $rows
  269.      * @access   public
  270.      */
  271.     function setRowCount($rows)
  272.     {
  273.         $this->_tbody->setRowCount($rows);
  274.     }
  275.  
  276.     /**
  277.      * Sets the number of columns in the table
  278.      * @param    int     $cols
  279.      * @access   public
  280.      */
  281.     function setColCount($cols)
  282.     {
  283.         $this->_tbody->setColCount($cols);
  284.     }
  285.  
  286.     /**
  287.      * Returns the number of rows in the table
  288.      * @access   public
  289.      * @return   int
  290.      */
  291.     function getRowCount()
  292.     {
  293.         return $this->_tbody->getRowCount();
  294.     }
  295.  
  296.     /**
  297.      * Gets the number of columns in the table
  298.      *
  299.      * If a row index is specified, the count will not take
  300.      * the spanned cells into account in the return value.
  301.      *
  302.      * @param    int    Row index to serve for cols count
  303.      * @access   public
  304.      * @return   int
  305.      */
  306.     function getColCount($row = null)
  307.     {
  308.         return $this->_tbody->getColCount($row);
  309.     }
  310.  
  311.     /**
  312.      * Sets a rows type 'TH' or 'TD'
  313.      * @param    int         $row    Row index
  314.      * @param    string      $type   'TH' or 'TD'
  315.      * @access   public
  316.      */
  317.  
  318.     function setRowType($row, $type)
  319.     {
  320.         $this->_tbody->setRowType($row, $type);
  321.     }
  322.  
  323.     /**
  324.      * Sets a columns type 'TH' or 'TD'
  325.      * @param    int         $col    Column index
  326.      * @param    string      $type   'TH' or 'TD'
  327.      * @access   public
  328.      */
  329.     function setColType($col, $type)
  330.     {
  331.         $this->_tbody->setColType($col, $type);
  332.     }
  333.  
  334.     /**
  335.      * Sets the cell attributes for an existing cell.
  336.      *
  337.      * If the given indices do not exist and autoGrow is true then the given
  338.      * row and/or col is automatically added.  If autoGrow is false then an
  339.      * error is returned.
  340.      * @param    int        $row         Row index
  341.      * @param    int        $col         Column index
  342.      * @param    mixed      $attributes  Associative array or string of table row attributes
  343.      * @access   public
  344.      * @throws   PEAR_Error
  345.      */
  346.     function setCellAttributes($row, $col, $attributes)
  347.     {
  348.         $ret = $this->_tbody->setCellAttributes($row, $col, $attributes);
  349.         if (PEAR::isError($ret)) {
  350.             return $ret;
  351.         }
  352.     }
  353.  
  354.     /**
  355.      * Updates the cell attributes passed but leaves other existing attributes in tact
  356.      * @param    int     $row         Row index
  357.      * @param    int     $col         Column index
  358.      * @param    mixed   $attributes  Associative array or string of table row attributes
  359.      * @access   public
  360.      */
  361.     function updateCellAttributes($row, $col, $attributes)
  362.     {
  363.         $ret = $this->_tbody->updateCellAttributes($row, $col, $attributes);
  364.         if (PEAR::isError($ret)) {
  365.             return $ret;
  366.         }
  367.     }
  368.  
  369.     /**
  370.      * Returns the attributes for a given cell
  371.      * @param    int     $row         Row index
  372.      * @param    int     $col         Column index
  373.      * @return   array
  374.      * @access   public
  375.      */
  376.     function getCellAttributes($row, $col)
  377.     {
  378.         return $this->_tbody->getCellAttributes($row, $col);
  379.     }
  380.  
  381.     /**
  382.      * Sets the cell contents for an existing cell
  383.      *
  384.      * If the given indices do not exist and autoGrow is true then the given
  385.      * row and/or col is automatically added.  If autoGrow is false then an
  386.      * error is returned.
  387.      * @param    int      $row        Row index
  388.      * @param    int      $col        Column index
  389.      * @param    mixed    $contents   May contain html or any object with a toHTML method;
  390.      *                                if it is an array (with strings and/or objects), $col
  391.      *                                will be used as start offset and the array elements
  392.      *                                will be set to this and the following columns in $row
  393.      * @param    string   $type       (optional) Cell type either 'TH' or 'TD'
  394.      * @access   public
  395.      * @throws   PEAR_Error
  396.      */
  397.     function setCellContents($row, $col, $contents, $type = 'TD')
  398.     {
  399.         $ret = $this->_tbody->setCellContents($row, $col, $contents, $type);
  400.         if (PEAR::isError($ret)) {
  401.             return $ret;
  402.         }
  403.     }
  404.  
  405.     /**
  406.      * Returns the cell contents for an existing cell
  407.      * @param    int        $row    Row index
  408.      * @param    int        $col    Column index
  409.      * @access   public
  410.      * @return   mixed
  411.      */
  412.     function getCellContents($row, $col)
  413.     {
  414.         return $this->_tbody->getCellContents($row, $col);
  415.     }
  416.  
  417.     /**
  418.      * Sets the contents of a header cell
  419.      * @param    int     $row
  420.      * @param    int     $col
  421.      * @param    mixed   $contents
  422.      * @param    mixed  $attributes Associative array or string of table row attributes
  423.      * @access   public
  424.      */
  425.     function setHeaderContents($row, $col, $contents, $attributes = null)
  426.     {
  427.         $this->_tbody->setHeaderContents($row, $col, $contents, $attributes);
  428.     }
  429.  
  430.     /**
  431.      * Adds a table row and returns the row identifier
  432.      * @param    array    $contents   (optional) Must be a indexed array of valid cell contents
  433.      * @param    mixed    $attributes (optional) Associative array or string of table row attributes
  434.      *                                This can also be an array of attributes, in which case the attributes
  435.      *                                will be repeated in a loop.
  436.      * @param    string   $type       (optional) Cell type either 'th' or 'td'
  437.      * @param    bool     $inTR           false if attributes are to be applied in TD tags
  438.      *                                    true if attributes are to be applied in TR tag
  439.      * @return   int
  440.      * @access   public
  441.      */
  442.     function addRow($contents = null, $attributes = null, $type = 'td', $inTR = false)
  443.     {
  444.         $ret = $this->_tbody->addRow($contents, $attributes, $type, $inTR);
  445.         return $ret;
  446.     }
  447.  
  448.     /**
  449.      * Sets the row attributes for an existing row
  450.      * @param    int      $row            Row index
  451.      * @param    mixed    $attributes     Associative array or string of table row attributes
  452.      *                                    This can also be an array of attributes, in which case the attributes
  453.      *                                    will be repeated in a loop.
  454.      * @param    bool     $inTR           false if attributes are to be applied in TD tags
  455.      *                                    true if attributes are to be applied in TR tag
  456.      * @access   public
  457.      * @throws   PEAR_Error
  458.      */
  459.     function setRowAttributes($row, $attributes, $inTR = false)
  460.     {
  461.         $ret = $this->_tbody->setRowAttributes($row, $attributes, $inTR);
  462.         if (PEAR::isError($ret)) {
  463.             return $ret;
  464.         }
  465.     }
  466.  
  467.     /**
  468.      * Updates the row attributes for an existing row
  469.      * @param    int      $row            Row index
  470.      * @param    mixed    $attributes     Associative array or string of table row attributes
  471.      * @param    bool     $inTR           false if attributes are to be applied in TD tags
  472.      *                                    true if attributes are to be applied in TR tag
  473.      * @access   public
  474.      * @throws   PEAR_Error
  475.      */
  476.     function updateRowAttributes($row, $attributes = null, $inTR = false)
  477.     {
  478.         $ret = $this->_tbody->updateRowAttributes($row, $attributes, $inTR);
  479.         if (PEAR::isError($ret)) {
  480.             return $ret;
  481.         }
  482.     }
  483.  
  484.     /**
  485.      * Returns the attributes for a given row as contained in the TR tag
  486.      * @param    int     $row         Row index
  487.      * @return   array
  488.      * @access   public
  489.      */
  490.     function getRowAttributes($row)
  491.     {
  492.         return $this->_tbody->getRowAttributes($row);
  493.     }
  494.  
  495.     /**
  496.      * Alternates the row attributes starting at $start
  497.      * @param    int      $start          Row index of row in which alternating begins
  498.      * @param    mixed    $attributes1    Associative array or string of table row attributes
  499.      * @param    mixed    $attributes2    Associative array or string of table row attributes
  500.      * @param    bool     $inTR           false if attributes are to be applied in TD tags
  501.      *                                    true if attributes are to be applied in TR tag
  502.      * @access   public
  503.      */
  504.     function altRowAttributes($start, $attributes1, $attributes2, $inTR = false)
  505.     {
  506.         $this->_tbody->altRowAttributes($start, $attributes1, $attributes2, $inTR);
  507.     }
  508.  
  509.     /**
  510.      * Adds a table column and returns the column identifier
  511.      * @param    array    $contents   (optional) Must be a indexed array of valid cell contents
  512.      * @param    mixed    $attributes (optional) Associative array or string of table row attributes
  513.      * @param    string   $type       (optional) Cell type either 'th' or 'td'
  514.      * @return   int
  515.      * @access   public
  516.      */
  517.     function addCol($contents = null, $attributes = null, $type = 'td')
  518.     {
  519.         return $this->_tbody->addCol($contents, $attributes, $type);
  520.     }
  521.  
  522.     /**
  523.      * Sets the column attributes for an existing column
  524.      * @param    int      $col            Column index
  525.      * @param    mixed    $attributes     (optional) Associative array or string of table row attributes
  526.      * @access   public
  527.      */
  528.     function setColAttributes($col, $attributes = null)
  529.     {
  530.         $this->_tbody->setColAttributes($col, $attributes);
  531.     }
  532.  
  533.     /**
  534.      * Updates the column attributes for an existing column
  535.      * @param    int      $col            Column index
  536.      * @param    mixed    $attributes     (optional) Associative array or string of table row attributes
  537.      * @access   public
  538.      */
  539.     function updateColAttributes($col, $attributes = null)
  540.     {
  541.         $this->_tbody->updateColAttributes($col, $attributes);
  542.     }
  543.  
  544.     /**
  545.      * Sets the attributes for all cells
  546.      * @param    mixed    $attributes        (optional) Associative array or string of table row attributes
  547.      * @access   public
  548.      */
  549.     function setAllAttributes($attributes = null)
  550.     {
  551.         $this->_tbody->setAllAttributes($attributes);
  552.     }
  553.  
  554.     /**
  555.      * Updates the attributes for all cells
  556.      * @param    mixed    $attributes        (optional) Associative array or string of table row attributes
  557.      * @access   public
  558.      */
  559.     function updateAllAttributes($attributes = null)
  560.     {
  561.         $this->_tbody->updateAllAttributes($attributes);
  562.     }
  563.  
  564.     /**
  565.      * Returns the table structure as HTML
  566.      * @access  public
  567.      * @return  string
  568.      */
  569.     function toHtml()
  570.     {
  571.         $strHtml = '';
  572.         $tabs = $this->_getTabs();
  573.         $tab = $this->_getTab();
  574.         $lnEnd = $this->_getLineEnd();
  575.         if ($this->_comment) {
  576.             $strHtml .= $tabs . "<!-- $this->_comment -->" . $lnEnd;
  577.         }
  578.         $strHtml .=
  579.             $tabs . '<table' . $this->_getAttrString($this->_attributes) . '>' . $lnEnd;
  580.         if (!empty($this->_caption)) {
  581.             $attr = $this->_caption['attr'];
  582.             $contents = $this->_caption['contents'];
  583.             $strHtml .= $tabs . $tab . '<caption' . $this->_getAttrString($attr) . '>';
  584.             if (is_array($contents)) {
  585.                 $contents = implode(', ', $contents);
  586.             }
  587.             $strHtml .= $contents;
  588.             $strHtml .= '</caption>' . $lnEnd;
  589.         }
  590.         if (!empty($this->_colgroup)) {
  591.             foreach ($this->_colgroup as $g => $col) {
  592.                 $attr = $this->_colgroup[$g]['attr'];
  593.                 $contents = $this->_colgroup[$g]['contents'];
  594.                 $strHtml .= $tabs . $tab . '<colgroup' . $this->_getAttrString($attr) . '>';
  595.                 if (!empty($contents)) {
  596.                     $strHtml .= $lnEnd;
  597.                     if (!is_array($contents)) {
  598.                         $contents = array($contents);
  599.                     }
  600.                     foreach ($contents as $a => $colAttr) {
  601.                         $attr = $this->_parseAttributes($colAttr);
  602.                         $strHtml .= $tabs . $tab . $tab . '<col' . $this->_getAttrString($attr) . '>' . $lnEnd;
  603.                     }
  604.                     $strHtml .= $tabs . $tab;
  605.                 }
  606.                 $strHtml .= '</colgroup>' . $lnEnd;
  607.             }
  608.         }
  609.         if ($this->_useTGroups) {
  610.             $tHeadColCount = 0;
  611.             if ($this->_thead !== null) {
  612.                 $tHeadColCount = $this->_thead->getColCount();
  613.             }
  614.             $tFootColCount = 0;
  615.             if ($this->_tfoot !== null) {
  616.                 $tFootColCount = $this->_tfoot->getColCount();
  617.             }
  618.             $tBodyColCount = 0;
  619.             if ($this->_tbody !== null) {
  620.                 $tBodyColCount = $this->_tbody->getColCount();
  621.             }
  622.             $maxColCount = max($tHeadColCount, $tFootColCount, $tBodyColCount);
  623.             if ($this->_thead !== null) {
  624.                 $this->_thead->setColCount($maxColCount);
  625.                 if ($this->_thead->getRowCount() > 0) {
  626.                     $strHtml .= $tabs . $tab . '<thead' .
  627.                                 $this->_getAttrString($this->_thead->_attributes) .
  628.                                 '>' . $lnEnd;
  629.                     $strHtml .= $this->_thead->toHtml($tabs, $tab);
  630.                     $strHtml .= $tabs . $tab . '</thead>' . $lnEnd;
  631.                 }
  632.             }
  633.             if ($this->_tfoot !== null) {
  634.                 $this->_tfoot->setColCount($maxColCount);
  635.                 if ($this->_tfoot->getRowCount() > 0) {
  636.                     $strHtml .= $tabs . $tab . '<tfoot' .
  637.                                 $this->_getAttrString($this->_tfoot->_attributes) .
  638.                                 '>' . $lnEnd;
  639.                     $strHtml .= $this->_tfoot->toHtml($tabs, $tab);
  640.                     $strHtml .= $tabs . $tab . '</tfoot>' . $lnEnd;
  641.                 }
  642.             }
  643.             if ($this->_tbody !== null) {
  644.                 $this->_tbody->setColCount($maxColCount);
  645.                 if ($this->_tbody->getRowCount() > 0) {
  646.                     $strHtml .= $tabs . $tab . '<tbody' .
  647.                                 $this->_getAttrString($this->_tbody->_attributes) .
  648.                                 '>' . $lnEnd;
  649.                     $strHtml .= $this->_tbody->toHtml($tabs, $tab);
  650.                     $strHtml .= $tabs . $tab . '</tbody>' . $lnEnd;
  651.                 }
  652.             }
  653.         } else {
  654.             $strHtml .= $this->_tbody->toHtml($tabs, $tab);
  655.         }
  656.         $strHtml .= $tabs . '</table>' . $lnEnd;
  657.         return $strHtml;
  658.     }
  659.  
  660. }
  661. ?>